package com.yf.exam.modules.exam.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yf.base.api.api.ApiRest;
import com.yf.base.api.api.controller.BaseController;
import com.yf.base.api.api.dto.PagingReqDTO;
import com.yf.exam.modules.exam.dto.request.ExamRecordReqDTO;
import com.yf.exam.modules.exam.dto.response.ExamRecordRespDTO;
import com.yf.exam.modules.exam.service.ExamRecordService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
* <p>
* 考试记录控制器
* </p>
*
* @author 聪明笨狗
* @since 2020-09-21 15:13
*/
@Log4j2
@Api(tags={"考试记录"})
@RestController
@RequestMapping("/api/user/exam")
public class ExamRecordController extends BaseController {

    @Autowired
    private ExamRecordService baseService;




    /**
     * 分页查找
     * @param reqDTO
     * @return
     */
    @ApiOperation(value = "分页查找")
    @PostMapping("/my-paging")
    public ApiRest<IPage<ExamRecordRespDTO>> MyPaging(@RequestBody PagingReqDTO<ExamRecordReqDTO> reqDTO) {

        //分页查询并转换
        IPage<ExamRecordRespDTO> page = baseService.myPaging(reqDTO);

        return super.success(page);
    }

}
